package org.dromara.common.tenant.core

import org.dromara.common.mybatis.core.domain.BaseEntity

/**
 * 租户基类
 *
 * @author Michelle.Chung
 * @updater LikeYouDo
 * @date 2025/1/8 12:53
 */
class TenantEntity(
    /**
     * 租户编号
     */
    var tenantId: String? = null
) : BaseEntity() {
    override fun equals(other: Any?): Boolean {
        if (this === other) return true
        if (other !is TenantEntity) return false
        if (!super.equals(other)) return false

        if (tenantId != other.tenantId) return false

        return true
    }

    override fun hashCode(): Int {
        var result = super.hashCode()
        result = 31 * result + (tenantId?.hashCode() ?: 0)
        return result
    }
}
